package multithread.print_by_turn;

/**
 * @Description:
 * @Author: Jason.zhu
 * @Create: 2019/11/25 16:22
 */

public class PrintByTurn {

    public static void main(String[] args){
        FooBar2 fooBar = new FooBar2(10);

        new Thread(() -> {
            try {
                fooBar.foo(new FooBar2.PrintFoo());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }).start();

        new Thread(() -> {
            try {
                fooBar.bar(new FooBar2.PrintBar());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }).start();
    }
}
